package com.huisang.springboot.entity;


import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.ToString;

import java.util.Date;

@Data
@ToString
@TableName("sys_user")
public class User {

    //@Alias()设置别名，可以让其导入，导出按照别名走

    @TableId(type = IdType.AUTO)
    @Alias("id")
    private Integer id;
    @TableField(value = "username")
    @Alias("用户名")
    private String username;
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    @TableField(value = "password")
    @Alias("密码")
    private String password;
    @TableField(value = "nickname")
    @Alias("昵称")
    private String nickname;
    @TableField(value = "email")
    @Alias("邮箱")
    private String email;
    @TableField(value = "phone")
    @Alias("电话")
    private String phone;
    @TableField(value = "address")
    @Alias("地址")
    private String address;
    @TableField(value = "avatarUrl")
    @Alias("头像地址")
    private String avatarUrl;
    @TableField(value = "create_time")
    @Alias("创建时间")
    private Date createTime;

}
